#pragma onec
#include <iostream>
#include <deque>
using namespace std;

namespace bit
{
    template<class T, class Con = deque<T>>
    class stack
    {
    public:
        stack():_c(){}
        void push(const T& x);
        void pop();
        T& top();
        const T& top()const;
        size_t size()const;
        bool empty()const;
    private:
        Con _c;
    };

    template<class T, class Con>
    void stack<T,Con>::push(const T& x)
    {
        _c.push_back(x);
    }

    template<class T, class Con>
    void stack<T,Con>::pop()
    {
        _c.pop_back();
    }

    template<class T, class Con>
    T& stack<T,Con>::top()
    {
        return _c.back();
    }

    template<class T, class Con>
    const T& stack<T,Con>::top() const
    {
        return _c.back();
    }

    template<class T, class Con>
    size_t stack<T,Con>::size() const
    {
        return _c.size();
    }

    template<class T, class Con>
    bool stack<T,Con>::empty() const
    {
        return _c.empty();
    }
};
